/*
 * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.iec.edp.caf.commons.runtime.msu.entities;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.iec.edp.caf.commons.runtime.msu.enums.MsuCommonType;
import lombok.Data;

import java.util.List;

/**
 * 后续msu的定义更新在此进行
 */
@Data
public class MsuCommonInfo {

    @JsonProperty(value = "ApplicationName")
    private String applicationName;

    @JsonProperty(value = "ApplicationNameAlias")
    private String applicationNameChs;

    @JsonProperty(value = "ServiceUnitName")
    private String name;

    @JsonProperty(value = "ServiceUnitNameAlias")
    private String nameChs;

    @JsonProperty(value = "Type")
    private String type;

    @JsonProperty(value = "ApplicationPath")
    private String path;

    private List<String> dependency;

    private String serviceUnitDes;

    @JsonProperty(value = "MsuType")
    private MsuCommonType msuCommonType;

    public MsuCommonInfo(){

    }

    //将子类转为父类
    public MsuCommonInfo(MsuCommonInfo commonInfo){
        this.applicationName = commonInfo.applicationName;
        this.applicationNameChs = commonInfo.applicationNameChs;
        this.name = commonInfo.getName();
        this.nameChs = commonInfo.getNameChs();
        this.type = commonInfo.getType();
        this.path = commonInfo.getPath();
        this.dependency = commonInfo.getDependency();
        this.serviceUnitDes = commonInfo.getServiceUnitDes();
        this.msuCommonType = commonInfo.getMsuCommonType();
    }
}
